<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="p" %>
<%String ctx = request.getContextPath(); %>

<jsp:include page="../common/operate.jsp">
	<jsp:param name="title1" value="产品列表"/>
	<jsp:param name="title2" value=""/>
	<jsp:param name="isShowAddBtn" value="true"/>
	<jsp:param name="isShowUpdateBtn" value="true"/>
	<jsp:param name="isShowDeleteBtn" value="true"/>
</jsp:include>


<div style="width:100%" class="f_l margin1">
	<s:form id="listForm" method="POST" theme="simple">
	    <table width="98%" cellspacing="0" cellpadding="0" border="0" class="clear f_l padding3" id="tb">
	      <tbody>
		      <tr class="bg4_nav">
		      	<td width="4%" class="t_c" style="border:0">
		        	<input onclick="javascript:batchSelect(this)" type="checkbox" style="border:0" name="List_Selected2">
		        </td>
		        <td width="14%" class="t_c" style="border:0">发布时间</td>
		        <td width="12%" class="t_c" style="border:0">发布人</td>
		        <td width="10%" class="t_c" style="border:0">产品名称</td>
		        <td width="100" class="t_c" style="border:0">产品描述</td>
		        <td width="10%" class="t_c" style="border:0">价格</td>
		        <td width="10%" class="t_c" style="border:0">积分兑换</td>
		        <td width="10%" class="t_c" style="border:0">积分</td>
		        <td width="10%" class="t_c" style="border:0">热卖</td>
		      </tr>
		      <s:iterator value="pager.result" status="count">
			  <tr align="center" onmouseover="this.bgColor='#F2E6E6'" onmouseout="this.bgColor=''" >
		        <td class="border_tb"><input type="checkbox" value="${id }" style="border:0" name="ids" /></td>
		        <td class="border_tb" style="cursor: pointer;" onclick="window.location.href='product!listDetail.action?id=${id}'"><s:date name="createdDate" format="yyyy-MM-dd"/> </td>
		        <td class="border_tb" style="cursor: pointer;" onclick="window.location.href='product!listDetail.action?id=${id}'">${publisherName }</td>
		        <td class="border_tb" style="cursor: pointer;" onclick="window.location.href='product!listDetail.action?id=${id}'">&nbsp;&nbsp;${name }</td>
			    <td class="border_tb" style="cursor: pointer;" onclick="window.location.href='product!listDetail.action?id=${id}'">
			      ${brief}
			    </td>
			    <td class="border_tb" style="cursor: pointer;" onclick="window.location.href='product!listDetail.action?id=${id}'">${price }</td>
			    <td class="border_tb" style="cursor: pointer;" onclick="window.location.href='product!listDetail.action?id=${id}'">
			    	<s:if test="%{exchange == 0}">否</s:if>
			    	<s:if test="%{exchange == 1}">是</s:if>
			    </td>
			    <td class="border_tb" style="cursor: pointer;" onclick="window.location.href='product!listDetail.action?id=${id}'">${points }</td>
			    <td class="border_tb" style="cursor: pointer;" onclick="window.location.href='product!listDetail.action?id=${id}'">
			      <s:if test="%{hot == 0}">否</s:if>
			      <s:if test="%{hot == 1}">是</s:if>
			    </td>
			  </tr>
			 </s:iterator>
	      </tbody>
	    </table>
    </s:form>
    <div class="f_l margin1"><img src="<%=ctx%>/img/business/main_07.jpg"></div>
</div>

<div class="f_l margin1" style="width:100%">
  <p:page pager="${pager}" url="product!list.action" namespace="/product"/>
</div>

<script type="text/javascript">
$(window).ready(function(){
	addOperate('addButton','<%=ctx%>/product/product!add');
	updateOperate('updateButton','<%=ctx%>/product/product!edit');
	batchDelete('deleteButton','listForm','<%=ctx%>/product/product!deleteAll');
	isAllSelected('listForm');	
});
</script>